import Vue from 'vue'
import 'babel-polyfill'
import App from './App'
import router from './router'
import store from './vuex/store'
import ElementUI from 'element-ui'
import VueLazyload from 'vue-lazyload'
// import {HAS_LOGINED} from './common/js/util'

import doctor from './assets/doctor.jpg'
Vue.use(ElementUI)
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: doctor,
  loading: doctor,
  attempt: 1
})
// Mock data
// import Mock from './mock'
// Mock.start()

// Navigation Guards -check logined or not
// router.beforeEach((to, from, next) => {
//   if (to.matched.some(record => record.meta.requiresAuth)) {
//     if (HAS_LOGINED) {
//       next()
//     } else {
//       next({
//         path: '/login',
//         query: { redirect: to.fullPath }
//       })
//     }
//   } else {
//     next()
//   }
// })

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
